const worker=new Worker("./worker.js")

//创建1字节缓冲区

const sharedArrayBuffer=new SharedArrayBuffer(1);

//创建1字节缓冲区的试图

const view=new Uint8Array(sharedArrayBuffer);

console.log('查看原始模样',view);

view[0]=5

worker.onmessage=()=>{
    console.log('buffer 值经过工作者线程修改后的值：'+view[0]);
}

worker.postMessage(sharedArrayBuffer);

